<h1 mat-dialog-title>{{ title | translate }}</h1>
<div mat-dialog-content id="unlock-msg">
  <div class="message-content">
    @if (errorDatasets.length > 0) {
      <div class="errors-content">
        <mat-divider></mat-divider>
        <p>{{ errorsMessage | translate }}</p>
        @for (dataset of errorDatasets; track dataset) {
          <div class="row">
            <strong>{{ dataset.name }}</strong>
            <div>
              <a ixTest="unlock-summary-details" (click)="showError(dataset)">
                <u>{{ 'details' | translate }}</u>
              </a>
              <ix-icon name="cancel" class="red-icon"></ix-icon>
            </div>
          </div>
        }
      </div>
    }
    @if (skippedDatasets.length > 0) {
      <div class="skipped-content">
        <mat-divider></mat-divider>
        <p>{{ skippedMessage | translate }}</p>
        @for (dataset of skippedDatasets; track dataset) {
          <div class="row">
            <strong>{{ dataset.name }}</strong>
            <ix-icon name="cancel" class="red-icon"></ix-icon>
          </div>
        }
      </div>
    }
    @if (unlockDatasets.length > 0) {
      <div class="unlock-content">
        <mat-divider></mat-divider>
        <p>{{ unlockMessage | translate }}</p>
        @for (dataset of unlockDatasets; track dataset) {
          <div class="row">
            <strong>{{ dataset.name }}</strong>
            <ix-icon name="check_circle" class="green-icon"></ix-icon>
          </div>
        }
      </div>
    }
  </div>
  <mat-divider></mat-divider>
  <ix-form-actions>
    <button
      id="unlock-dialog__cancel-button"
      mat-button
      name="cancel_button"
      class="mat-mdc-button mat-button mat-accent"
      ixTest="close"
      (click)="cancel()"
    >
      {{ cancelMessage | translate }}
    </button>
    @if (!final) {
      <button
        id="unlock-dialog__action-button"
        mat-button
        name="ok_button"
        class="mat-mdc-button mat-button mat-primary"
        ixTest="continue"
        (click)="submit()"
      >
        {{ buttonMessage | translate }}
      </button>
    }
  </ix-form-actions>
</div>
